package com.qf.joint.service.impl;

import com.qf.joint.dao.ShareDao;
import com.qf.joint.pojo.Share;
import com.qf.joint.service.ShareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Author H
 * Date on 2020/9/13  16:29
 * @description
 */
@Service("shareService")
public class ShareServiceImpl implements ShareService {
    @Autowired(required = false)

    private ShareDao shareDao;

    @Override
    public int selectCount() {
        return shareDao.selectCount();
    }

    @Override
    //根据ID查询
    public Share selectById(int id) {
        return shareDao.selectById(id);
    }

    //查询
    @Override
    public List<Share> selectAll() {
        return shareDao.selectAll();
    }

    @Override
    public List<Share> selectByCon(String condition) {
        return shareDao.selectByCon(condition);
    }

    @Override
    //新增
    public int insertOne(Share share) {
        return shareDao.insertOne(share);
    }

    @Override
    //修改
    public int updateOne(Share share) {
        return shareDao.updateOne(share);
    }

    @Override
    //删除
    public int deleteOne(List<String> list) {

        return shareDao.deleteOne(list);
    }

   /* @Override
    public List<Share> list() {
        return shareDao.list();
    }


    @Override
    @Transactional
    public String save(MultipartFile file, Share share, ModelMap map) throws IOException {
        String filePath = "D:\\LX";
        String originalFilename = file.getOriginalFilename();
// 生成文件新的名字
        String newFileName = UUID.randomUUID() + originalFilename;
        // 封装上传文件位置的全路径
        File targetFile = new File(filePath, newFileName);
        file.transferTo(targetFile);
        //保存在数据库
        share.setLogo(newFileName);
        shareDao.save(share);
        return "redirect:/listImages";
    }*/
}
